import time as _time
import torch as _torch
from src.networks import ExpTripletNetwork as _use_net

_name = str(__name__)
_time = _time.strftime('%m-%d %H:%M:%S', _time.localtime())


USE_NET = _use_net

# Dataset
DATASET_PROC_METHOD_TRAIN = 'Rescale'
DATASET_PROC_METHOD_VAL = 'Rescale'
#

# Category
MAX_CATEGORY_NUM = 1  #只学习最常见的那么多类，其中一类是Other，所以只会选最常见的63类

# NetWork相关
IMAGE_EMBED_SIZE = 512
NEGATIVE_SAMPLE_WITH_TYPE = True
LEARNED_FIELD_EMBED = False
LEARNED_FIELD_BIAS = False

TRIPLET_MARGIN = 0.2
LEARNED_METRICS = False

# WEIGHT
WEIGHT_TRIPLET = 1.0
WEIGHT_L1_MASK = 0.1
WEIGHT_L2_GENERAL_EMB = 0.1

# Word Embdding 相关
USE_PRETRAINED_WORD_EMBEDDING = False
WORD_EMBED_SIZE = 300  # 这个是和之前word2vec保持一致的
MAX_VOCAB_SIZE = 300
OUTFIT_NAME_PAD_NUM = 10 # 保留那么多单词
###



# TRAIN：训练时选项
NUM_EPOCH = 70
LEARNING_RATE = 0.0001
LEARNING_RATE_DECAY = 0.95
BATCH_SIZE = 64
SAVE_EVERY_STEPS = 10000
SAVE_EVERY_EPOCHS = 1

# VAL：测试时选项
VAL_WHILE_TRAIN = True
VAL_FASHION_COMP_FILE = "fashion_compatibility_small.txt"
VAL_FITB_FILE = "fill_in_blank_test_small.json"
VAL_BATCH_SIZE = 8
VAL_EVERY_STEPS = 1000
VAL_EVERY_EPOCHS = 1
VAL_START_EPOCH = 1

# auto
device = _torch.device('cuda:0' if _torch.cuda.is_available() else 'cpu')
TRAIN_DIR = 'runs/%s/' % _name + _time
VAL_DIR = 'runs/%s/' % _name + _time
MODEL_NAME = '%s' % _name

